home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Classes / 2.0_PetriDish / PetriDish / DrawPetriDish.psw next >
Encoding:
Text File  |  1992-07-02  |  1.7 KB  |  88 lines

  1. defineps drawPetriDish(float width, halfWidth, radius, petriRed, petriGreen, petriBlue)
  2.     1 setalpha
  3.     1.0 setgray
  4.     0 0 width width rectfill
  5.  
  6.     0.0 setgray
  7.     2 setlinewidth
  8.     0 0 moveto
  9.     width 0 lineto
  10.     width width lineto
  11.     0 width lineto
  12.     0 0 lineto
  13.     closepath
  14.     stroke
  15.         
  16.     halfWidth halfWidth translate  
  17.     0.0 setgray
  18.     1.0 setalpha
  19.     2.0 setlinewidth
  20.     0 0 radius 0 360 arc
  21.     gsave
  22.     petriRed petriGreen petriBlue setrgbcolor
  23.     fill
  24.     grestore
  25.     stroke  
  26. endps
  27.  
  28. defineps drawGrid(float width, halfWidth, radius, spacing) 
  29.     0.0 setalpha
  30.     1.0 setgray
  31.     0 0 width width rectfill
  32.     
  33.     halfWidth halfWidth translate 
  34.     0.0 setlinewidth
  35.     0 0 radius 0 360 arc
  36.     clip
  37.     
  38.     gsave
  39.     newpath
  40.     1 setalpha
  41.     0.3333 setgray
  42.     0 halfWidth neg translate 
  43.     0 spacing halfWidth {0 moveto 0 width rlineto} for
  44.     spacing spacing halfWidth {neg 0 moveto 0 width rlineto} for 
  45.     stroke
  46.     grestore
  47.  
  48.     gsave
  49.     newpath
  50.     1 setalpha
  51.     0.3333 setgray
  52.     halfWidth neg 0 translate 
  53.     0 spacing halfWidth {0 exch moveto width 0 rlineto} for
  54.     spacing spacing halfWidth {neg 0 exch moveto width 0 rlineto} for 
  55.     stroke
  56.     grestore
  57. endps
  58.  
  59. defineps drawSpot(float width, halfWidth, radius, red, green, blue)
  60.     0.0 setalpha
  61.     1.0 setgray
  62.     0 0 width width rectfill
  63.     
  64.     halfWidth halfWidth translate 
  65.     0.0 setlinewidth
  66.     1.0 setalpha
  67.     red green blue setrgbcolor
  68.     0 0 radius 0 360 arc
  69.     fill
  70. endps    
  71.  
  72. defineps drawCursor()
  73.     0.0 setalpha
  74.     1.0 setgray
  75.     0 0 16.0 16.0 rectfill
  76.     
  77.     1 setalpha
  78.     0 setgray
  79.     0.0 setlinewidth
  80.     
  81.     0 8.5 moveto
  82.     16 8.5 lineto
  83.     8.5 0 moveto
  84.     8.5 16 lineto
  85.     stroke
  86. endps        
  87.     
  88.